import vue from '@vitejs/plugin-vue'

// const mdPlugin = require('vite-plugin-markdown')
import path from 'path';
import requireTransform from 'vite-plugin-require-transform';

export default {
    base: './',
    plugins: [
        vue(),
        requireTransform({
            fileRegex: /.ts$|.tsx$|.vue$/
            //   fileRegex:/.js$|.jsx$|.vue$/
        }),
    ],
    optimizeDeps: {
        // include: ['schart.js']
    },
    resolve: {
        alias: [
            {
                find: '@antv/x6',
                replacement: '@antv/x6/dist/x6.js',
            },
            {
                find: '@antv/x6-vue-shape',
                replacement: '@antv/x6-vue-shape/lib',
            },
            {
                find: '@',
                replacement: path.resolve(__dirname, 'src'),
            },
        ],
    },
    css: {
        preprocessorOptions: {}
    },
    server: {
        port: 8080,
        // proxy: {
        //     '/carmanage': {
        //         // target: ' http://10.6.72.184:8081',
        //         target: 'http://autodrive-test.hozonauto.com',
        //         changeOrigin: true,
        //         loglevel: "debug",
        //         rewrite: path => path.replace(/^\/carmanage/, '')
        //     },
        //     '/web/user': {
        //         // target: 'http://10.4.2.39:8100/web/',
        //         target: 'http://autodrive-test.hozonauto.com/web',
        //         changeOrigin: true,
        //         loglevel: "debug",
        //         rewrite: path => path.replace(/^\/web/, '')
        //     },
        //     '/web': {
        //         // target: 'http://10.6.72.184:8095/web/',
        //         target: 'http://asset.autodrive.hozonauto.com/web',
        //         changeOrigin: true,
        //         loglevel: "debug",
        //         rewrite: path => path.replace(/^\/web/, '')
        //     },

        // },
        hmr: true,
        // https:true
    },
    publicDir:'./plugins'
}

